package edu.bbu.commonproject.desktop.client.factory.thrift;


import edu.bbu.commonproject.desktop.client.factory.CLTFactory;
import edu.bbu.commonproject.desktop.client.services.DirectoryCLTServices;
import edu.bbu.commonproject.desktop.client.services.FileCLTServices;
import edu.bbu.commonproject.desktop.client.services.UserCLTServices;
import edu.bbu.commonproject.desktop.client.services.thrift.directories.ThriftDirectoryCLTServices;
import edu.bbu.commonproject.desktop.client.services.thrift.files.ThriftFileCLTServices;
import edu.bbu.commonproject.desktop.client.services.thrift.users.ThriftUserCLTServices;
import edu.bbu.commonproject.desktop.client.utils.ThriftExecutor;
import edu.bbu.commonproject.desktop.gui.controller.utils.SystemProperties;

/**
 * The thrift client factory.
 */
public class ThriftCLTFactory extends CLTFactory
{
	/** The server host adress. */
	public static final String HOST_ADRESS = SystemProperties.getValue(SystemProperties.HOST_ADRESS);
	
	/** The thrift communication port. */
	public static final int THRIFT_PORT = Integer.parseInt(SystemProperties.getValue(SystemProperties.THRIFT_PORT));
	
	/** The socket communication port. */
	public static final int SOCKET_PORT = Integer.parseInt(SystemProperties.getValue(SystemProperties.SOCKET_PORT));
	
	/**
	 * Getting the thrift service executor.
	 * @return the thrift service executor.
	 */
	public static ThriftExecutor getExecutor()
	{
		return new ThriftExecutor(HOST_ADRESS, THRIFT_PORT);
	}
	
	/**
	 * Getting the thrift client, user services.
	 */
	public UserCLTServices getUserCLTServices()
	{
		return new ThriftUserCLTServices();
	}
	
	/**
	 * Getting the thrift client file services.
	 */
	public FileCLTServices getFileCLTServices()
	{
		return new ThriftFileCLTServices();
	}

	/**
	 * Getting the thrift client directory services.
	 */
	public DirectoryCLTServices getDirectoryCLTServices()
	{
		return new ThriftDirectoryCLTServices();
	}
	
}
